package com.csust.automaticteach.manager.auth.annotation;

import cn.dev33.satoken.annotation.handler.SaAnnotationHandlerInterface;
import cn.dev33.satoken.annotation.handler.SaCheckPermissionHandler;
import com.csust.automaticteach.manager.auth.StpKit;
import org.springframework.stereotype.Component;

import java.lang.reflect.AnnotatedElement;

/**
 * 注解 SaUserCheckLogin 的处理器
 */
//@Component
public class SaSpaceCheckLoginHandler implements SaAnnotationHandlerInterface<SaSpaceCheckPermission> {

    @Override
    public Class<SaSpaceCheckPermission> getHandlerAnnotationClass() {
        return SaSpaceCheckPermission.class;
    }

    @Override
    public void checkMethod(SaSpaceCheckPermission at, AnnotatedElement element) {
        SaCheckPermissionHandler._checkMethod(StpKit.SPACE_TYPE,at.value(),at.mode(),at.orRole());// StpKit.SPACE_TYPE
    }

}
